package fyf.com.carddesign.main.admin;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.kyleduo.switchbutton.SwitchButton;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import fyf.com.carddesign.BaseActivity;
import fyf.com.carddesign.Dao.Card;
import fyf.com.carddesign.R;


/**
 * 修改卡片信息
 * Created by yxz on 2017/11/2.
 */

public class AlertCardActivity extends BaseActivity {
    private AlertCardActivity _parent;
    private Bundle _bundle = null;
    private Card _objCard;
    @BindView(R.id.tbb_tv_name)
    TextView _tvTitleName;
    @BindView(R.id.alert_et_title)
    EditText _etTitle;//卡片头部
    @BindView(R.id.alert_et_notice)
    EditText _etNotice;//卡片提示信息
    @BindView(R.id.alert_tv_date)
    TextView _tvDate;
    @BindView(R.id.alert_sb)
    SwitchButton _sBtn;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        _parent = AlertCardActivity.this;
        ButterKnife.bind(this);
        _tvTitleName.setText("修改卡片信息");
        if (_bundle == null) {
            _bundle = getIntent().getExtras();
            _objCard = (Card) _bundle.getSerializable("Card");
        }

        _etTitle.setText(_objCard.getName());
        _etNotice.setText(_objCard.getText());
        _tvDate.setText(_objCard.getAdd_date());
    }

    @OnClick(R.id.alert_btn)
    public void alertClick(View view) {

    }

    @Override
    public int getLayoutId() {
        return R.layout.alert_card;
    }

    @OnClick(R.id.tbb_ll_back)
    public void onBack(View v) {
        _parent.finish();
    }
}
